/*
 * XML Type:  tags
 * Namespace: 
 * Java type: com.guardianapis.api.domain.xmlbeans.Tags
 *
 * Automatically generated - do not modify.
 */
package com.guardianapis.api.domain.xmlbeans.impl;
/**
 * An XML tags(@).
 *
 * This is a complex type.
 */
public class TagsImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.guardianapis.api.domain.xmlbeans.Tags
{
    private static final long serialVersionUID = 1L;
    
    public TagsImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TAG$0 = 
        new javax.xml.namespace.QName("", "tag");
    private static final javax.xml.namespace.QName COUNT$2 = 
        new javax.xml.namespace.QName("", "count");
    private static final javax.xml.namespace.QName STARTINDEX$4 = 
        new javax.xml.namespace.QName("", "start-index");
    
    
    /**
     * Gets array of all "tag" elements
     */
    public com.guardianapis.api.domain.xmlbeans.Tag[] getTagArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(TAG$0, targetList);
            com.guardianapis.api.domain.xmlbeans.Tag[] result = new com.guardianapis.api.domain.xmlbeans.Tag[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "tag" element
     */
    public com.guardianapis.api.domain.xmlbeans.Tag getTagArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Tag target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Tag)get_store().find_element_user(TAG$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "tag" element
     */
    public int sizeOfTagArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TAG$0);
        }
    }
    
    /**
     * Sets array of all "tag" element
     */
    public void setTagArray(com.guardianapis.api.domain.xmlbeans.Tag[] tagArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(tagArray, TAG$0);
        }
    }
    
    /**
     * Sets ith "tag" element
     */
    public void setTagArray(int i, com.guardianapis.api.domain.xmlbeans.Tag tag)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Tag target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Tag)get_store().find_element_user(TAG$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(tag);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "tag" element
     */
    public com.guardianapis.api.domain.xmlbeans.Tag insertNewTag(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Tag target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Tag)get_store().insert_element_user(TAG$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "tag" element
     */
    public com.guardianapis.api.domain.xmlbeans.Tag addNewTag()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Tag target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Tag)get_store().add_element_user(TAG$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "tag" element
     */
    public void removeTag(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TAG$0, i);
        }
    }
    
    /**
     * Gets the "count" attribute
     */
    public int getCount()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COUNT$2);
            if (target == null)
            {
                return 0;
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) the "count" attribute
     */
    public org.apache.xmlbeans.XmlInt xgetCount()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(COUNT$2);
            return target;
        }
    }
    
    /**
     * Sets the "count" attribute
     */
    public void setCount(int count)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COUNT$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(COUNT$2);
            }
            target.setIntValue(count);
        }
    }
    
    /**
     * Sets (as xml) the "count" attribute
     */
    public void xsetCount(org.apache.xmlbeans.XmlInt count)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(COUNT$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlInt)get_store().add_attribute_user(COUNT$2);
            }
            target.set(count);
        }
    }
    
    /**
     * Gets the "start-index" attribute
     */
    public int getStartIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTINDEX$4);
            if (target == null)
            {
                return 0;
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) the "start-index" attribute
     */
    public org.apache.xmlbeans.XmlInt xgetStartIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(STARTINDEX$4);
            return target;
        }
    }
    
    /**
     * Sets the "start-index" attribute
     */
    public void setStartIndex(int startIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTINDEX$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STARTINDEX$4);
            }
            target.setIntValue(startIndex);
        }
    }
    
    /**
     * Sets (as xml) the "start-index" attribute
     */
    public void xsetStartIndex(org.apache.xmlbeans.XmlInt startIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(STARTINDEX$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlInt)get_store().add_attribute_user(STARTINDEX$4);
            }
            target.set(startIndex);
        }
    }
}
